package com.hongmeng.teamwork.factory.attachment;

import com.google.common.collect.Lists;
import com.google.common.net.HttpHeaders;
import com.hongmeng.teamwork.entity.dto.AttachmentDto;
import com.hongmeng.teamwork.enums.AttachmentEnum;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 附件处理器
 */
public interface AttachmentHandler {

    default Map<String, List<String>> getHeader() {
        Map<String, List<String>> header = new HashMap<>();
        header.put(HttpHeaders.CONTENT_TYPE, Lists.newArrayList("multipart/form-data; boundary=---7MA4YWxkTrZu0gW"));
        return header;
    }

    AttachmentEnum getEnum();

    String upload(AttachmentDto attachmentDto) throws Exception;
}
